//
//  HomeNewSourceListCell.m
//  NtoccDriver
//
//  Created by mac on 2019/11/26.
//  Copyright © 2019 zhuchongjin. All rights reserved.
//

#import "HomeNewSourceListCell.h"
@interface HomeNewSourceListCell()
@property (nonatomic,strong) CJLabel *labShipperAdress;
@property (nonatomic,strong) CJLabel *labConsigneeAdress;
@property (nonatomic,strong) CJLabel *labPrice;
@property (nonatomic,strong) CJLabel *labData;
@property (nonatomic,strong) CJView *viewData;
@property (nonatomic,strong) CJView *viewBottomLine;
@property (nonatomic,strong) CJView *viewTopLine;
@end
@implementation HomeNewSourceListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    // Configure the view for the selected state
}

- (void)setCellInfoWithModel:(HomeNewSourceListModel *)model{
    
    self.labShipperAdress.text = model.shipperAddress;
    self.labConsigneeAdress.text = model.consigneeAddress;
    self.labPrice.text = CJStringWithFormat(@"%@元/吨",@(model.price).cj_money_description);
    self.labData.text = model.coalBigTypeName;
    if ([CJRegular getIsStrEmpty:model.coalBigTypeName]) {
        self.viewData.hidden = YES;
    }else{
        self.viewData.hidden = NO;
    }
}

- (void)drawRect:(CGRect)rect{
    [CJControl drawLineOfDashByCAShapeLayer:self.viewBottomLine lineLength:2 lineSpacing:1.5 lineColor:[UIColor cjBackgroundColor] lineDirection:NO];
    [CJControl drawLineOfDashByCAShapeLayer:self.viewTopLine lineLength:2 lineSpacing:1.5 lineColor:[UIColor cjBackgroundColor] lineDirection:NO];
}

@end
